<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ include file="../../include/laypublic.jsp" %>
<%@ include file="../../include/vueComponent.jsp" %>
<!DOCTYPE html>
<html>
<head>
    <title>投标决策详情</title>
</head>
<link rel="stylesheet" href="${ctx}/resources/vue-element-lib/detail.css">
<body>
<div id="app">
    <div class="layui-tab layui-tab-brief" lay-filter="xqxx-tab-all">
        <ul class="layui-tab-title">
            <li id="tbglId" class="layui-this" lay-id="0">投标决策详情</li>
            <li id="zgysId" lay-id="1">历史审批信息</li>
        </ul>
        <div class="layui-tab-content" style="height: 100px;">
            <div class="layui-tab-item layui-show">
                <div class="container">
                    <el-form ref="formRef" label-width="180px" label-suffix="："
                             label-position="left">
                        <%--项目基础信息--%>
                        <div class="base-info">
                            <div class="title">
                                <h3>项目基础信息</h3>
                            </div>
                            <!--表单-->
                            <el-row>
                                <x-col>
                                    <el-form-item label="项目名称">
                                        <span>{{info.proName}}</span>
                                    </el-form-item>
                                </x-col>
                                <x-col position="right">
                                    <el-form-item label="所属公司">
                                        <span>{{info.compName}}</span>
                                    </el-form-item>
                                </x-col>
                            </el-row>
                            <el-row>
                                <x-col>
                                    <el-form-item label="项目编码">
                                        <span>{{info.proCode}}</span>
                                    </el-form-item>
                                </x-col>
                                <x-col position="right">
                                    <el-form-item label="营销经理">
                                        <span>{{info.staffName}}</span>
                                    </el-form-item>
                                </x-col>
                            </el-row>
                            <el-row>
                                <x-col>
                                    <el-form-item label="实施机构">
                                        <span>{{info.carryOrg}}</span>
                                    </el-form-item>
                                </x-col>
                                <x-col position="right">
                                    <el-form-item label="回报机制">
                                        <span>{{info.backMech}}</span>
                                    </el-form-item>
                                </x-col>
                            </el-row>
                            <el-row>
                                <x-col>
                                    <el-form-item label="投资总额">
                                        <span>{{info.sumAmount}}</span>
                                    </el-form-item>
                                </x-col>
                                <x-col position="right">
                                    <el-form-item label="建安工程费用(亿元)">
                                        <span>{{info.costCae}}</span>
                                    </el-form-item>
                                </x-col>
                            </el-row>
                            <el-row>
                                <x-col>
                                    <el-form-item label="建设周期">
                                        <span>{{info.buildYears}}</span>
                                    </el-form-item>
                                </x-col>
                                <x-col position="right">
                                    <el-form-item label="运营周期">
                                        <span>{{info.omYears}}</span>
                                    </el-form-item>
                                </x-col>
                            </el-row>
                            <el-row>
                                <x-col>
                                    <el-form-item label="投标保证金截止日期">
                                        <span>{{info.bondEndDate}}</span>
                                    </el-form-item>
                                </x-col>
                                <x-col position="right">
                                    <el-form-item label="投标保证金(万元)">
                                        <span>{{info.bondMoney}}</span>
                                    </el-form-item>
                                </x-col>
                            </el-row>
                            <el-row>
                                <x-col position="full">
                                    <el-form-item label="项目简介">
                                        <span>{{info.proRemarks}}</span>
                                    </el-form-item>
                                </x-col>
                            </el-row>
                        </div>
                        <%--项目投资构成--%>
                        <div class="title">
                            <h3>项目投资构成</h3>
                        </div>
                        <el-row>
                            <x-col>
                                <el-form-item label="建安工程费(万元)">
                                    <x-input v-model="info.costCae" name="建安工程费" disabled/>
                                </el-form-item>
                            </x-col>
                            <x-col position="right">
                                <el-form-item label="设备购置工程费(万元)">
                                    <x-input v-model="info.deviceCost" name="设备购置工程费" disabled/>
                                </el-form-item>
                            </x-col>

                        </el-row>
                        <el-row>
                            <x-col>
                                <el-form-item label="工程建设其他费(万元)">
                                    <x-input v-model="info.otherCost" name="工程建设其他费" disabled/>
                                </el-form-item>
                            </x-col>
                            <x-col position="right">
                                <el-form-item label="征地拆迁费(万元)">
                                    <x-input v-model="info.moveOutCost" name="征地拆迁费" disabled/>
                                </el-form-item>
                            </x-col>
                        </el-row>
                        <el-row>
                            <x-col>
                                <el-form-item label="预备费(万元)">
                                    <x-input v-model="info.inReadyCost" name="预备费" disabled/>
                                </el-form-item>
                            </x-col>
                            <x-col position="right">
                                <el-form-item label="建设期利息(万元)">
                                    <x-input v-model="info.periodInterest" name="建设期利息" disabled/>
                                </el-form-item>
                            </x-col>
                        </el-row>
                        <%--经济分析--%>
                        <div class="title" style="margin-top: 30px">
                            <h3>经济分析</h3>
                        </div>
                        <el-row>
                            <x-col>
                                <el-form-item label="资本金要求">
                                    <x-input v-model="info.capitalFund" name="资本金要求" disabled/>
                                </el-form-item>
                            </x-col>
                            <x-col position="right">
                                <el-form-item label="股权比例(%)">
                                    <x-input v-model="info.stockPercent" name="股权比例" disabled/>
                                </el-form-item>
                            </x-col>
                        </el-row>
                        <el-row>
                            <x-col>
                                <el-form-item label="建安下浮率(%)">
                                    <x-input v-model="info.jianAnDownRate" name="建安下浮率" disabled/>
                                </el-form-item>
                            </x-col>
                            <x-col position="right">
                                <el-form-item label="合理利润率(%)">
                                    <x-input v-model="info.profitRate" name="合理利润率" disabled/>
                                </el-form-item>
                            </x-col>
                        </el-row>
                        <el-row>
                            <x-col>
                                <el-form-item label="综合回报率(%)">
                                    <x-input v-model="info.compreRate" name="综合回报率" disabled/>
                                </el-form-item>
                            </x-col>
                            <x-col position="right">
                                <el-form-item label="年度折现率(%)">
                                    <x-input v-model="info.yearDiscountRate" name="年度折现率" disabled/>
                                </el-form-item>
                            </x-col>
                        </el-row>
                        <el-row>
                            <x-col>
                                <el-form-item label="建筑施工利润率(%)">
                                    <x-input v-model="info.buildConstrRate" name="建筑施工利润率" disabled/>
                                </el-form-item>
                            </x-col>
                            <x-col position="right">
                                <el-form-item label="投资利润率(%)">
                                    <x-input v-model="info.investProfitRate" name="投资利润率" disabled/>
                                </el-form-item>
                            </x-col>
                        </el-row>
                        <el-row>
                            <x-col>
                                <el-form-item label="运营利润(%)">
                                    <x-input v-model="info.operatProfit" name="运营利润" disabled/>
                                </el-form-item>
                            </x-col>
                            <x-col position="right">
                                <el-form-item label="综合利润(%)">
                                    <x-input v-model="info.comperProfit" name="综合利润" disabled/>
                                </el-form-item>
                            </x-col>
                        </el-row>
                        <div class="title">
                            <h3>项目其他信息</h3>
                        </div>
                        <el-row>
                            <x-col>
                                <el-form-item label="意向申请会议日期">
                                    <el-date-picker v-model="info.intentionMeetTime" style="width: 100%" type="date"
                                                    disabled
                                                    value-format="yyyy-MM-dd" placeholder="意向申请会议日期"></el-date-picker>
                                </el-form-item>
                            </x-col>
                            <x-col position="right">
                                <el-form-item label="财政支付的政府">
                                    <x-input v-model="info.financePayGov" name="财政支付的政府" disabled/>
                                </el-form-item>
                            </x-col>
                        </el-row>
                        <el-row>
                            <x-col>
                                <el-form-item label="上一年财政预算收入">
                                    <x-input v-model="info.upYearRevenue" name="上一年财政预算收入" disabled/>
                                </el-form-item>
                            </x-col>
                            <x-col position="right">
                                <el-form-item label="入库所处阶段">
                                    <x-input v-model="info.storeStage" name="入库所处阶段" disabled/>
                                </el-form-item>
                            </x-col>
                        </el-row>
                        <el-row>
                            <x-col>
                                <el-form-item label="是否有居间人">
                                    <x-select v-model="info.isBroker" :options="yesOrNo" name="是否有居间人"
                                              disabled></x-select>
                                </el-form-item>
                            </x-col>
                            <x-col position="right">
                                <el-form-item label="预计居间人费用">
                                    <x-input v-model="info.brokerMoney" name="预计居间人费用" disabled/>
                                </el-form-item>
                            </x-col>
                        </el-row>
                        <el-row>
                            <x-col>
                                <el-form-item label="是否入财政部项目库">
                                    <x-select v-model="info.isProjectLib" :options="yesOrNo" disabled
                                              name="是否入财政部项目库"></x-select>
                                </el-form-item>
                            </x-col>
                            <x-col position="right">
                                <el-form-item label="是否决策投标">
                                    <x-select v-model="info.isDecBid" :options="yesOrNo" name="是否决策投标"
                                              disabled></x-select>
                                </el-form-item>
                            </x-col>
                        </el-row>
                        <el-row>
                            <x-col position="full">
                                <el-form-item label="初步融资方案" prop="remark">
                                    <x-input v-model="info.financingOptions" name="项目简介" type="textarea" disabled
                                             :rows="4"></x-input>
                                </el-form-item>
                            </x-col>
                        </el-row>
                        <el-row>
                            <x-col position="full">
                                <el-form-item label="项目风险" prop="remark">
                                    <el-table :data="riskTable" style="width: 100%" border
                                              v-if="riskTable&&riskTable.length>0">
                                        <el-table-column prop="riskDesc" label="风险描述" align="center"></el-table-column>
                                        <el-table-column prop="riskLevel" label="风险等级" align="center"></el-table-column>
                                        <el-table-column prop="solveWay" label="处理策略" align="center">
                                            <template slot-scope="scope">
                                                {{scope.row.riskSolveWays[scope.row.solveWay].name}}
                                            </template>
                                        </el-table-column>
                                        <el-table-column prop="latestProgress" label="最新进展"
                                                         align="center"></el-table-column>
                                    </el-table>
                                    <template v-else>无</template>
                                </el-form-item>
                            </x-col>
                        </el-row>
                        <el-row>
                            <x-col position="full">
                                <el-form-item label="其他说明" prop="remark">
                                    <x-input v-model="info.otherInstructions" name="其他说明" type="textarea" disabled
                                             :rows="4"></x-input>
                                </el-form-item>
                            </x-col>
                        </el-row>
                        <div class="title">
                            <h3>项目附件信息</h3>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label" style="width:350px;">支持pdf、excel、word、图片资料，可上传多个</label>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">标前承诺</label>
                            <div class="layui-input-block">
                                <div class="layui-upload">
                                    <div class="layui-upload-list" id="41-upload-more-list">
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">居间合同</label>
                            <div class="layui-input-block">
                                <div class="layui-upload">

                                    <div class="layui-upload-list" id="42-upload-more-list">
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">融资调研报告</label>
                            <div class="layui-input-block">
                                <div class="layui-upload">
                                    <div class="layui-upload-list" id="18-upload-more-list">
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">运营调研报告</label>
                            <div class="layui-input-block">
                                <div class="layui-upload">
                                    <div class="layui-upload-list" id="16-upload-more-list">
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">招商调研报告</label>
                            <div class="layui-input-block">
                                <div class="layui-upload">
                                    <div class="layui-upload-list" id="17-upload-more-list">
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">当地PPP项目调研报告 </label>
                            <div class="layui-input-block">
                                <div class="layui-upload">
                                    <div class="layui-upload-list" id="19-upload-more-list">
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">招标文件</label>
                            <div class="layui-input-block">
                                <div class="layui-upload">
                                    <div class="layui-upload-list" id="20-upload-more-list">
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">PPP合同范本</label>
                            <div class="layui-input-block">
                                <div class="layui-upload">
                                    <div class="layui-upload-list" id="21-upload-more-list">
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">投资测算表</label>
                            <div class="layui-input-block">
                                <div class="layui-upload">
                                    <div class="layui-upload-list" id="22-upload-more-list">
                                    </div>
                                </div>
                            </div>
                        </div>
                    </el-form>
                </div>
            </div>
            <div class="layui-tab-item">
                <%@ include file="lay-processHistory-detail.jsp" %>
            </div>
        </div>
    </div>
</div>
<script src="${ctx}/resources/vue-element-lib/jquery.js"></script>
<script>
    // 封装上传文件
    let fileArr = [];

    var staticPath = '${fileHttpPre}';
    layui.config({
        base: '${ctx}/resources/layuiadmin/' //静态资源所在路径
    }).extend({
        index: 'lib/index' //主入口模块
    }).use(['index', 'set', 'upload', 'table', 'transfer', 'laydate', 'element', 'layer'], function () {
        var $ = layui.$
            , upload = layui.upload
            , table = layui.table
            , element = layui.element
            , layer = layui.layer;
    });

    //删除文件
    function del(index) {
        layui.$("#fileAtt_" + index).remove();
        layui.$("#upload_img_" + index).remove();
        fileArr.map((el, idx) => {
            if (el.split('|')[2] == index) {
                fileArr.splice(idx, 1)
            }
        })
    }

    //根据url查看文件
    function showImg(url) {
        var openWin = window.open(url, '', 'left=410,height=768, width=1024, top=200,  toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, status=no');
    }

    /*核心*/
    var vm = new Vue({
        el: '#app',
        data() {
            return {
                layId: '0',
                procNodeList: [],
                tempNodeList: [],
                auditMsg: '',//审批意见
                riskTable: [],


                date: '2021-01-01',
                info: {},//信息
                yesOrNo: [],
                id: '',
            }
        },
        created() {
            let that = this;
            that.id = "${id}";
            that.processId = "${processId}";
            that.queryProcessList();
        },
        mounted() {

        },
        methods: {
            showFile(fileList) {
                if (fileList.length > 0) {
                    fileArr = fileList;
                    for (let i in fileList) {
                        let contractInfo = fileList[i];
                        let arr = contractInfo.split("|");
                        let imgSrc = "";
                        let suffix = arr[1].substring(arr[1].lastIndexOf(".") + 1, arr[1].length);
                        if (suffix == 'jpg' || suffix == 'png') {
                            imgSrc = "${fileHttpPre}/" + arr[3];
                        } else {
                            imgSrc = "${ctx}/resources/images/" + suffix + ".jpg";
                        }
                        $('#' + arr[0] + '-upload-more-list')
                            .append('<div class="layui-upload-img-div" id="upload_img_' + arr[2] + '"><img src="' + imgSrc + '" title="'
                                + arr[1] + '" class="layui-upload-img"><div class="mask"><a href="javascript:void(0)" onclick="showImg(\'' + "${fileHttpPre}"
                                + arr[3] + '\');">查看</a><a href="javascript:void(0)" onclick="del(\''
                                + arr[2] + '\')";>删除</a></div><p>' + arr[1] + '</p><input type="hidden" value="'
                                + contractInfo + '" id="fileAtt_' + arr[2] + '" name="fileAtts" ></input></div> ');
                    }
                }
            },
            queryProcessList() {
                let that = this;
                $.ajax({
                    type: 'post',
                    url: basePath + '/historyProcess/proNodeDetail',  //请求数据接口
                    data: {processId: that.processId},
                    success: function (result) {
                        that.procNodeList = result.entity.procNodeList;
                        that.tempNodeList = result.entity.tempNodeList;
                        that.info = result.entity.detailJson.info;
                        that.yesOrNo = result.entity.detailJson.yesOrNo;
                        that.riskTable = result.entity.detailJson.riskTable;
                        if (fileArr.length == 0) {
                            that.showFile(result.entity.detailJson.fileAtt)
                        }
                    }
                });
            },
        }
    })
</script>
</body>
</html>

